package com.jingdianjichi.subject.application.convert;

import com.jingdianjichi.subject.application.dto.SubjectCategoryDTO;
import com.jingdianjichi.subject.domain.entiy.SubjectCategoryBO;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.Mapping;

import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface SubjectCategoryDTOConverter {
    SubjectCategoryDTOConverter INSTANCE = Mappers.getMapper(SubjectCategoryDTOConverter.class);
    @Mappings({
            @Mapping(source = "subjectCategoryDTO.id", target = "id"),
            @Mapping(source = "subjectCategoryDTO.categoryName", target = "categoryName"),
            @Mapping(source = "subjectCategoryDTO.categoryType", target = "categoryType"),
            @Mapping(source = "subjectCategoryDTO.imageUrl", target = "imageUrl"),
            @Mapping(source = "subjectCategoryDTO.parentId", target = "parentId"),
            @Mapping(source = "subjectCategoryDTO.count", target = "count")
    })
    SubjectCategoryBO convertBoToCategory(SubjectCategoryDTO subjectCategoryDTO);


    List<SubjectCategoryDTO> convertBoToCategoryDTOList(List<SubjectCategoryBO> subjectCategoryDTO);

    SubjectCategoryBO convertDtoToCategoryBO(SubjectCategoryDTO subjectCategoryDTO);

    SubjectCategoryDTO convertBoToCategoryDTO(SubjectCategoryBO subjectCategoryBO);
}
